cmake_minimum_required(VERSION 2.8)

message("-- Project: msgbus")

file(GLOB msgbus_src "*.cpp")
		
add_library(msgbus SHARED 	${msgbus_src})
set_target_properties(msgbus PROPERTIES OUTPUT_NAME "msgbus")
target_link_libraries(msgbus stdcrt)

include_directories(
	${PROJECT_SOURCE_DIR}/include
	${PROJECT_SOURCE_DIR}/crt
	${PROJECT_SOURCE_DIR}/extensions/include
	${by3rd_library_include})


if (${WIN_OS})

	target_link_libraries(msgbus shlwapi)
	set(CMAKE_SHARED_LINKER_FLAGS 
		"${CMAKE_SHARED_LINKER_FLAGS} /DEF:${PROJECT_SOURCE_DIR}/msgbus/dllexports.def")

else()

	include_directories(
		/usr/local/include
		/opt/local/include
		/usr/include
		)

	set_target_properties(msgbus PROPERTIES COMPILE_FLAGS ${dynamic})
	set_target_properties(msgbus PROPERTIES COMPILE_FLAGS ${compile})
	set_target_properties(msgbus PROPERTIES LINK_FLAGS ${r_path})

	if(${LINUX_OS})
		target_link_libraries(msgbus dl)
	endif()

	if(${UNIX_OS})
		target_link_libraries(msgbus)
	endif()


endif()






